package com.wyh.mapper.appmapper;

import com.github.pagehelper.Page;
import com.wyh.domain.dto.groupfour.customerDTO.AddInvoiceHeaderDTO;
import com.wyh.domain.dto.groupfour.customerDTO.UpdateInvoiceHeaderDTO;
import com.wyh.domain.dto.depositDTO.DepositHistoryByIdDTO;
import com.wyh.domain.dto.depositDTO.DepositHistoryDTO;
import com.wyh.domain.vo.gruopfour.myProprietorVO.MyPaymentRecordVO;
import com.wyh.domain.vo.gruopfour.myProprietorVO.PayDataVO;
import com.wyh.domain.vo.gruopfour.myVO.*;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MyMapper {

    Page<PayDataVO> getPayData(Integer id);


    //根据账单id查询账单信息数据
    BillInformationVO getBillData(Integer customerId);



    Page<MyPaymentRecordVO> getPaymentRecord(Integer customerId);

    Page<InvoiceHeaderVO> getInvoiceHeaderList(Integer id);

    //新增抬头

    void addInvoiceHeader(AddInvoiceHeaderDTO invoiceheader);

    void updateInvoiceHeader(UpdateInvoiceHeaderDTO invoiceheader);

    List<BillDetailDataVO> getBillDetails(Integer billingResourcesId);

    //查询详细账单1.根据账单id查询该账单下的所有资源id
    @Select("SELECT DISTINCT billingresourcesid FROM billdetails  where billid=#{billId}")
    List<Integer> getBillDetailsResourceId(Integer billId);

    //根据资源id查询该资源的名称去重
    @Select("SELECT DISTINCT billingresources FROM billdetails  where billingresourcesid=#{billingResourcesId}")
    String getBillDetailsResourceName(Integer billingResourcesId);

    //获取保证金历史数据
    List<DepositHistoryVO> getDepositHistory(DepositHistoryDTO depositHistoryDTO);

    //根据保证金类型查保证金历史数据
    List<DepositHistoryVO> getDepositHistoryByType(DepositHistoryByIdDTO depositHistoryByIdDTO);

    //根据客户id在合同表查所有资源id

    List<ContractVO> getConsumerResourceId(Integer id);

    // 根据资源id通用余额查询
    List<BalanceHistoryVO> getGeneralBalanceHistory(Integer id);

    //根据资源id查询水电气余额
    List<BalanceHistoryVO> getSpecialBalanceHistory(Integer id);

    //根据账单id查询水电预存抵扣
    Double getPrepaidAccountInformation(Integer id);

    //根据账单id查询通用预存抵扣
    Double getGenerealAccountInformation(Integer id);






}
